\hypertarget{classfraction}{
\section{fraction Class Reference}
\label{classfraction}\index{fraction@{fraction}}
}


Class representing fractions.  




{\ttfamily \#include $<$fraction.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classfraction_a1cacd44ea092068fd0623b191ee91e7f}{simplify} ()
\begin{DoxyCompactList}\small\item\em Simplifies the fraction. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_a94ac643d9d4114b74698add1e07a1315}{
void \hyperlink{classfraction_a94ac643d9d4114b74698add1e07a1315}{print} ()}
\label{classfraction_a94ac643d9d4114b74698add1e07a1315}

\begin{DoxyCompactList}\small\item\em Prints the fraction. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_af54e35e29e13e31cb7df325e09802147}{
double \hyperlink{classfraction_af54e35e29e13e31cb7df325e09802147}{fr\_\-sqrt} ()}
\label{classfraction_af54e35e29e13e31cb7df325e09802147}

\begin{DoxyCompactList}\small\item\em Square root of a fraction. \item\end{DoxyCompactList}\item 
\hyperlink{classfraction_afebb1a11234f677874b0ba58b561a759}{fraction} (long long \hyperlink{classfraction_a66a4eea9de72a1c880889a519587dc2b}{p}, long long \hyperlink{classfraction_a98ee3b4e042001ab45cf3382047926b1}{q}=1)
\begin{DoxyCompactList}\small\item\em Fraction constructor. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_a5ecc30d1b071c1f8382bdb63cd52fb8a}{
\hyperlink{classfraction}{fraction} \hyperlink{classfraction_a5ecc30d1b071c1f8382bdb63cd52fb8a}{operator+} (\hyperlink{classfraction}{fraction} a)}
\label{classfraction_a5ecc30d1b071c1f8382bdb63cd52fb8a}

\begin{DoxyCompactList}\small\item\em Add fractions. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_a3e79b75634ab7cf64b10a0635746a53b}{
\hyperlink{classfraction}{fraction} \hyperlink{classfraction_a3e79b75634ab7cf64b10a0635746a53b}{operator-\/} (\hyperlink{classfraction}{fraction} a)}
\label{classfraction_a3e79b75634ab7cf64b10a0635746a53b}

\begin{DoxyCompactList}\small\item\em Substract fractions. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_a511003cd42c2fa60ac94071f16f9875a}{
\hyperlink{classfraction}{fraction} \hyperlink{classfraction_a511003cd42c2fa60ac94071f16f9875a}{operator$\ast$} (\hyperlink{classfraction}{fraction} a)}
\label{classfraction_a511003cd42c2fa60ac94071f16f9875a}

\begin{DoxyCompactList}\small\item\em Multiply fractions. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_a7134b58a99c4d610ce602010d1db7000}{
\hyperlink{classfraction}{fraction} \hyperlink{classfraction_a7134b58a99c4d610ce602010d1db7000}{operator$\ast$} (long long a)}
\label{classfraction_a7134b58a99c4d610ce602010d1db7000}

\begin{DoxyCompactList}\small\item\em Multiply fraction by a number. \item\end{DoxyCompactList}\item 
\hypertarget{classfraction_accf016dcd786413498c412f213d5cc88}{
\hyperlink{classfraction}{fraction} \hyperlink{classfraction_accf016dcd786413498c412f213d5cc88}{operator/} (\hyperlink{classfraction}{fraction} a)}
\label{classfraction_accf016dcd786413498c412f213d5cc88}

\begin{DoxyCompactList}\small\item\em Divide fractions. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
long long \hyperlink{classfraction_a66a4eea9de72a1c880889a519587dc2b}{p}
\item 
long long \hyperlink{classfraction_a98ee3b4e042001ab45cf3382047926b1}{q}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class representing fractions. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classfraction_afebb1a11234f677874b0ba58b561a759}{
\index{fraction@{fraction}!fraction@{fraction}}
\index{fraction@{fraction}!fraction@{fraction}}
\subsubsection[{fraction}]{\setlength{\rightskip}{0pt plus 5cm}fraction::fraction (
\begin{DoxyParamCaption}
\item[{long long}]{ p, }
\item[{long long}]{ q = {\ttfamily 1}}
\end{DoxyParamCaption}
)}}
\label{classfraction_afebb1a11234f677874b0ba58b561a759}


Fraction constructor. 


\begin{DoxyParams}{Parameters}
\item[{\em p}]Long long value that will become the numerator of the fraction \item[{\em q}]Long long value that will become the denominator of the fraction \end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classfraction_a1cacd44ea092068fd0623b191ee91e7f}{
\index{fraction@{fraction}!simplify@{simplify}}
\index{simplify@{simplify}!fraction@{fraction}}
\subsubsection[{simplify}]{\setlength{\rightskip}{0pt plus 5cm}void fraction::simplify (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classfraction_a1cacd44ea092068fd0623b191ee91e7f}


Simplifies the fraction. 

Simplifies the fraction by dividing its numerator and denominator by theirs greatest common divisor. 

\subsection{Member Data Documentation}
\hypertarget{classfraction_a66a4eea9de72a1c880889a519587dc2b}{
\index{fraction@{fraction}!p@{p}}
\index{p@{p}!fraction@{fraction}}
\subsubsection[{p}]{\setlength{\rightskip}{0pt plus 5cm}long long {\bf fraction::p}}}
\label{classfraction_a66a4eea9de72a1c880889a519587dc2b}
Numerator of a fraction \hypertarget{classfraction_a98ee3b4e042001ab45cf3382047926b1}{
\index{fraction@{fraction}!q@{q}}
\index{q@{q}!fraction@{fraction}}
\subsubsection[{q}]{\setlength{\rightskip}{0pt plus 5cm}long long {\bf fraction::q}}}
\label{classfraction_a98ee3b4e042001ab45cf3382047926b1}
Denominator of a fraction 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
fraction.h\item 
fraction.cpp\end{DoxyCompactItemize}
